import request from '@/utils/request'

export function getUserList (data) {
  return request({
    url: '/user/list',
    method: 'post',
    data
  })
}

export function deleteUserById (id) {
  return request({
    url: '/user/deleteById',
    method: 'get',
    params: { id }
  })
}

export function addUser (data) {
  return request({
    url: '/user/addUser',
    method: 'post',
    data
  })
}

export function updateUser (data) {
  return request({
    url: '/user/updateUser',
    method: 'post',
    data
  })
}

export function queryUserByWorkerNum (params) {
  return request({
    url: '/user/checkWorkerNum',
    method: 'get',
    params
  })
}

export function queryUserByUsername (params) {
  return request({
    url: '/user/checkUsername',
    method: 'get',
    params
  })
}
